package com.hdd.biz.app.controller;

import com.hdd.biz.app.dto.*;
import com.hdd.biz.app.service.UserCenterService;
import com.hdd.biz.finance.dto.PaymetListRequest;
import com.hdd.dto.SuperResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

@RestController
@RequestMapping("/app/center")
@Api(value = "小程序-我的",tags = {"小程序-我的"})
public class UserCenterController {

    @Autowired
    private UserCenterService userCenterService;

    @PostMapping("/info")
    @ApiOperation(value = "我的信息" ,notes = "")
    public AppResponse info(@Valid @RequestBody AppRequest request){
        return userCenterService.userInfo(request);
    }


    @PostMapping("/infoEditor")
    @ApiOperation(value = "我的信息编辑" ,notes = "")
    public AppResponse infoEditor(@Valid @RequestBody InfoEditorRequest request ){
        return userCenterService.updateUserInfo(request);
    }

    @PostMapping("/uploadAvatar")
    @ApiOperation(value = "上传头像" ,notes = "")
    public AppResponse uploadAvatar(@Valid @RequestBody UploadAvatarRequest request ){
        return userCenterService.uploadAvatar(request);
    }

    @PostMapping("/myWorks")
    @ApiOperation(value = "我的作品" ,notes = "")
    public AppResponse works(@Valid @RequestBody MyWorksRequest request ){
        return userCenterService.myWorksList(request);
    }

    @PostMapping("/myWiki")
    @ApiOperation(value = "我的百科作品" ,notes = "")
    public AppResponse myWiki(@Valid @RequestBody MyWorksRequest request ){
        return userCenterService.myWikiList(request);
    }

    @PostMapping("/drafts")
    @ApiOperation(value = "草稿箱作品" ,notes = "")
    public AppResponse drafts(@Valid @RequestBody FansRequest request ){
        return userCenterService.drafts(request);
    }

    @PostMapping("/delDrafts")
    @ApiOperation(value = "删除草稿箱" ,notes = "")
    public AppResponse delDrafts(@Valid @RequestBody WorksInfoRequest request ){
        return userCenterService.delDrafts(request);
    }


    @PostMapping("/prefer")
    @ApiOperation(value = "喜欢的作品（废弃）" ,notes = "")
    public AppResponse prefer(@Valid @RequestBody MyWorksRequest request ){
        return userCenterService.myLikeList(request);
    }


    @PostMapping("/preferList")
    @ApiOperation(value = "喜欢的作品(列表)" ,notes = "")
    public AppResponse preferList(@Valid @RequestBody MyWorksRequest request ){
        return userCenterService.preferList(request);
    }

    @PostMapping("/preferSelect")
    @ApiOperation(value = "喜欢的作品(选中)" ,notes = "")
    public AppResponse preferSelect(@Valid @RequestBody MyWorksRequest request ){
        return userCenterService.preferSelect(request);
    }

    @PostMapping("/preferDown")
    @ApiOperation(value = "喜欢的作品（下拉）" ,notes = "")
    public AppResponse preferDown(@Valid @RequestBody MyWorksRequest request ){
        return userCenterService.preferDown(request);
    }

    @PostMapping("/preferUp")
    @ApiOperation(value = "喜欢的作品（上拉）" ,notes = "")
    public AppResponse preferUp(@Valid @RequestBody MyWorksRequest request ){
        return userCenterService.preferUp(request);
    }


    @PostMapping("/fans")
    @ApiOperation(value = "粉丝" ,notes = "")
    public AppResponse fans(@Valid @RequestBody FansRequest request ){
        return userCenterService.fans(request);
    }


    @PostMapping("/bindPhone")
    @ApiOperation(value = "绑定手机" ,notes = "")
    public AppResponse bindPhone(@Valid @RequestBody BindPhoneRequest request ){
        return userCenterService.bindPhone(request);
    }

    @PostMapping("/follow")
    @ApiOperation(value = "关注" ,notes = "")
    public AppResponse follow(@Valid @RequestBody FansRequest request ){
        return userCenterService.follow(request);
    }

    @PostMapping("/followTotal")
    @ApiOperation(value = "关注/粉丝统计" ,notes = "")
    public AppResponse followTotal(@Valid @RequestBody FansRequest request ){
        return userCenterService.followTotal(request);
    }

    @PostMapping("/worksTotal")
    @ApiOperation(value = "作品关注统计" ,notes = "")
    public AppResponse worksTotal(@Valid @RequestBody FansRequest request ){
        return userCenterService.worksTotal(request);
    }

    @PostMapping("/allowReward")
    @ApiOperation(value = "是否运行赞赏" ,notes = "")
    public AppResponse allowReward(@Valid @RequestBody WorksInfoRequest request ){
        return userCenterService.allowReward(request);
    }

    @PostMapping("/isFollow")
    @ApiOperation(value = "是否关注" ,notes = "")
    public AppResponse isFollow(@Valid @RequestBody WorksInfoRequest request ){
        return userCenterService.isFollow(request);
    }

}
